@extends("admin.frame_layout")
<?php $top_selected = "工作台";$page_menu = "消费明细" ?>
@section('content')
    <div class="rightinfo">

        <div class="tools">
            <form method="get" action="{{route('admin.consume')}}" id="form_s">
                <ul class="toolbar">
                    <li><input name="start" type="text" placeholder="开始时间"
                               onClick="laydate({istime: true,format: 'YYYY-MM-DD hh:mm:ss'})"></li>
                    <li><input name="end" type="text" placeholder="结束时间"
                               onClick="laydate({istime: true,format: 'YYYY-MM-DD hh:mm:ss'})"></li>
                    <li>
                        <select name="search_type">
                            <option value="1">用户账号</option>
                            <option value="2">用户编号</option>
                            <option value="3">用户ID</option>
                        </select>
                    </li>
                    <li><input id="search_str" name="search_str" type="text" placeholder="搜索条件"></li>
                    <li>
                        <a href="javascript:void(0)" onclick="$('#form_s').submit()">
                            <span><img src="{{asset('admin/imgs/ico06.png')}}" width="20px" height="20px"/></span>搜索
                        </a>
                    </li>
                </ul>
            </form>
        </div>
        <table class="tablelist">
            <thead>
            <tr>
                <th width="70px">操作</th>
                <th width="100">ID<i class="sort"><img src="{{asset('admin/imgs/px.gif')}}"/></i></th>
                <th width="100">编号<i class="sort"><img src="{{asset('admin/imgs/px.gif')}}"/></i></th>
                <th>会员账号</th>
                <th>钱包账户</th>
                <th>类型</th>
                <th>变动金额</th>
                <th style="text-align: left;">描述</th>
                <th width="160px">时间</th>
            </tr>
            </thead>
            <tbody>
            @foreach($logs as $log)
                <tr>
                    <td class="act" bind="#{{$log->id}}">
                        <img src="{{asset('admin/imgs/t05.png')}}"/>菜单
                        <ul id="{{$log->id}}">
                            <li>
                                <img src="{{asset('admin/imgs/d02.png')}}"/>不可操作
                            </li>
                        </ul>
                    </td>
                    <td>{{$log->id}}</td>
                    <td>{{$log->no}}</td>
                    <td>{{$log->username}}</td>
                    <td>
                        @if($log->wallet == \App\Models\MWallet::$WALLET_TYPE_1)
                            奖金币钱包
                        @elseif($log->wallet == \App\Models\MWallet::$WALLET_TYPE_2)
                            报单币钱包
                        @elseif($log->wallet == \App\Models\MWallet::$WALLET_TYPE_3)
                            购物币钱包
                        @endif
                    </td>
                    <td>
                        @if($log->type == \App\Models\MConsumeLog::$CONSUME_RECHARGE)
                            充值
                        @elseif($log->type == \App\Models\MConsumeLog::$CONSUME_DEDUCTING)
                            消费
                        @endif
                    </td>
                    <td>{{$log->money}}</td>
                    <td class="text-left">{{$log->intro}}</td>
                    <td>{{date("Y-m-d H:i:s",$log->time)}}</td>
                </tr>
            @endforeach
            </tbody>
        </table>
        @include('admin.coms.fenye')
    </div>

@endsection

@section('footer')
    <script src="{{asset('admin/js/laydate/laydate.js')}}"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            laydate.skin("dahong"); //大红色日期选择皮肤
            //初始化表格操作菜单
            $('.tablelist tbody tr:odd').addClass('odd');
            $(".tablelist .act").hover(function () {
                $($(this).attr("bind")).show();
            }, function () {
                $($(this).attr("bind")).hide();
            });
        });
    </script>
@endsection
